public class SplayTreeTest {

    public static void main(String[] args){
        int arr[] = {5,4,6,3};

        SplayTree<Integer> splayTree = new SplayTree<>();
        for(int anArr:arr){
             splayTree.insert(anArr);
        }


        //打印树
        System.out.println("root:" + splayTree.getRoot().key);
        printArr1(splayTree);

        //进行搜索节点33
        splayTree.search(5);
        System.out.println("root:" + splayTree.getRoot().key);
        printArr1(splayTree);

//        //进行删除节点8
//        splayTree.remove(8);
//        System.out.println("root:" + splayTree.getRoot().key);
//        printArr1(splayTree);
    }

    private static void printArr(SplayTree<Integer> splayTree){
        System.out.println("当前树的中序遍历如下：");
        splayTree.inOrder();
        System.out.println();
    }

    private static void printArr1(SplayTree<Integer> splayTree){
        System.out.println("当前树的前序遍历如下：");
        splayTree.preOrder();
        System.out.println();
    }

    private static void printArr2(SplayTree<Integer> splayTree){
        System.out.println("当前树的后续遍历如下：");
        splayTree.postOrder();
        System.out.println();
    }
}
